<html>
<head><meta charset="utf-8"><title>how to debug rust-analyzer&#x27;s interaction with VS Code · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html">how to debug rust-analyzer&#x27;s interaction with VS Code</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="160195933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160195933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160195933">(Mar 07 2019 at 13:18)</a>:</h4>
<p>I'm trying to work out problems with my installation of the VS Code extension; I'm seeing essentially a bunch of "unknown file: /Users/fklock/Dev/Rust/play/src/main.rs" (see also <a href="https://github.com/rust-analyzer/rust-analyzer/issues/717" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/717">rust-analyzer#717</a>)</p>



<a name="160195975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160195975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160195975">(Mar 07 2019 at 13:19)</a>:</h4>
<p>but my most immediate question is: what is the best way to try to debug this? The two routes I can imagine are:</p>



<a name="160196000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196000">(Mar 07 2019 at 13:19)</a>:</h4>
<p>have you updated recently?</p>



<a name="160196002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196002">(Mar 07 2019 at 13:19)</a>:</h4>
<p>Either 1. Try to emulate whatever request that Code is sending to <code>ra_lsp_server</code>, and use that locally</p>



<a name="160196010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196010">(Mar 07 2019 at 13:19)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/pull/940" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/pull/940">https://github.com/rust-analyzer/rust-analyzer/pull/940</a> should give you feedback for when stuff was loaded succesfully.</p>



<a name="160196012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196012">(Mar 07 2019 at 13:19)</a>:</h4>
<blockquote>
<p>have you updated recently?</p>
</blockquote>
<p>I believe I'm using currently nightly</p>



<a name="160196077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196077">(Mar 07 2019 at 13:20)</a>:</h4>
<p>I mean, updating rust-analyzer itself. <code>git pull &amp; cargo jinstall-lsp</code></p>



<a name="160196083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196083">(Mar 07 2019 at 13:20)</a>:</h4>
<p>(<code>j</code> for jemalloc)</p>



<a name="160196092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196092">(Mar 07 2019 at 13:20)</a>:</h4>
<blockquote>
<p>Either 1. Try to emulate whatever request that Code is sending to <code>ra_lsp_server</code>, and use that locally</p>
</blockquote>
<p>Or 2. Figure out how to get <em>more</em> debug info from the Code output terminal; e.g. figure out how to make it set RUST_LOG etc</p>



<a name="160196102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196102">(Mar 07 2019 at 13:20)</a>:</h4>
<p>by "nightly" I meant</p>



<a name="160196104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196104">(Mar 07 2019 at 13:21)</a>:</h4>
<p>a locally built rust-analyzer</p>



<a name="160196121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vipentti <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196121">(Mar 07 2019 at 13:21)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/DEBUGGING.md" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/DEBUGGING.md">https://github.com/rust-analyzer/rust-analyzer/blob/master/DEBUGGING.md</a> can this be used ?</p>



<a name="160196129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196129">(Mar 07 2019 at 13:21)</a>:</h4>
<p>let me try to double-check whether that belief is true</p>



<a name="160196130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196130">(Mar 07 2019 at 13:21)</a>:</h4>
<p>For debugging, I just to </p>
<div class="codehilite"><pre><span></span>$ env RUST_LOG=gen_lsp_server=trace code .
</pre></div>



<a name="160196137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196137">(Mar 07 2019 at 13:21)</a>:</h4>
<p>Hmm okay</p>



<a name="160196144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196144">(Mar 07 2019 at 13:21)</a>:</h4>
<p>(I'm on Mac OS X so I don't always invoke things from command line)</p>



<a name="160196192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196192">(Mar 07 2019 at 13:22)</a>:</h4>
<p>but I think I can get the same effect</p>



<a name="160196228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196228">(Mar 07 2019 at 13:22)</a>:</h4>
<p>why "gen_lsp_server" and not "ra_lsp_server" ?</p>



<a name="160196229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196229">(Mar 07 2019 at 13:22)</a>:</h4>
<p>I belive we can set debug level here: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/5232099977d07492c1b6d5e6163c70d4f6eb07df/editors/code/src/server.ts#L15-L18" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/5232099977d07492c1b6d5e6163c70d4f6eb07df/editors/code/src/server.ts#L15-L18">https://github.com/rust-analyzer/rust-analyzer/blob/5232099977d07492c1b6d5e6163c70d4f6eb07df/editors/code/src/server.ts#L15-L18</a></p>



<a name="160196263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196263">(Mar 07 2019 at 13:23)</a>:</h4>
<p><code>gen_lsp_server</code> is the "generic" lsp library, so it's the thing which actually sends and reads JSON</p>



<a name="160196273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196273">(Mar 07 2019 at 13:23)</a>:</h4>
<p>tracing it gives you the most complete picture, though its a lot of data</p>



<a name="160196293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196293">(Mar 07 2019 at 13:23)</a>:</h4>
<p>ah okay. So doing RUST_LOG=gen_lsp_server would let me see the actual JSON that is sent on the "pipe"</p>



<a name="160196358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196358">(Mar 07 2019 at 13:24)</a>:</h4>
<p>I belive @DJMcNab implemented some cool tracing of requests on the client side as well: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/302" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/pull/302">https://github.com/rust-analyzer/rust-analyzer/pull/302</a></p>



<a name="160196366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196366">(Mar 07 2019 at 13:24)</a>:</h4>
<p>though I've never had a chance to try that infra</p>



<a name="160196471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vipentti <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196471">(Mar 07 2019 at 13:26)</a>:</h4>
<p>Yeah , you can set <code>"rust-analyzer.trace.server": "verbose"</code> in your settings.json to get tracing from the client</p>



<a name="160196505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196505">(Mar 07 2019 at 13:27)</a>:</h4>
<blockquote>
<p>Yeah , you can set <code>"rust-analyzer.trace.server": "verbose"</code> in your settings.json to get tracing from the client</p>
</blockquote>
<p>oh okay well I actually did do that. But it didn't quite tell me enough for me to immediately figure out how to replicate the same input stream manually when interacting with a manually invoked <code>ra_lsp_server</code></p>



<a name="160196537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196537">(Mar 07 2019 at 13:27)</a>:</h4>
<p>or at least, I didn't know how to take the trace output and feed it into the running <code>ra_lsp_server</code>; it errors out after the first input I provided saying it expected an initialization</p>



<a name="160196546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196546">(Mar 07 2019 at 13:27)</a>:</h4>
<p>(and that's about when I decided to ask in here rather than dissect further)</p>



<a name="160196606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196606">(Mar 07 2019 at 13:28)</a>:</h4>
<blockquote>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/DEBUGGING.md" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/DEBUGGING.md">https://github.com/rust-analyzer/rust-analyzer/blob/master/DEBUGGING.md</a> can this be used ?</p>
</blockquote>
<p>I hadn't actually looked at this yet, let me look now</p>



<a name="160196646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196646">(Mar 07 2019 at 13:29)</a>:</h4>
<p>Heh, I personally never try to manually feed rust-analyzer with data. Rather, I use logging/printf + running the real VS Code instance.</p>



<a name="160196654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196654">(Mar 07 2019 at 13:29)</a>:</h4>
<p>basically, if you press <code>F5</code>, you'll get a new vscode instance with isolated rust-analyzer</p>



<a name="160196660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196660">(Mar 07 2019 at 13:29)</a>:</h4>
<p>build freshly from source</p>



<a name="160196750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196750">(Mar 07 2019 at 13:30)</a>:</h4>
<p>If you do want to feed it "manually", the best way is probably to write a "heavy_test" in "heavy_tests/main.rs", which has some infra for communicating with ra set up</p>



<a name="160196786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196786">(Mar 07 2019 at 13:31)</a>:</h4>
<p>okay. I'm not committed to either strategy (of trying to isolate ra_lsp_server vs working with the integrated setup)</p>



<a name="160196790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vipentti <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196790">(Mar 07 2019 at 13:31)</a>:</h4>
<p>I think you can perform the requests manually if you run the initialization from <a href="https://github.com/rust-analyzer/rust-analyzer/blob/5232099977d07492c1b6d5e6163c70d4f6eb07df/crates/gen_lsp_server/src/lib.rs#L86-L105" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/5232099977d07492c1b6d5e6163c70d4f6eb07df/crates/gen_lsp_server/src/lib.rs#L86-L105">https://github.com/rust-analyzer/rust-analyzer/blob/5232099977d07492c1b6d5e6163c70d4f6eb07df/crates/gen_lsp_server/src/lib.rs#L86-L105</a></p>



<a name="160196795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196795">(Mar 07 2019 at 13:31)</a>:</h4>
<p>though some of the docs in DEBUGGING.md is definitely linux-centric. <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span> <span aria-label="apple" class="emoji emoji-1f34e" role="img" title="apple">:apple:</span></p>



<a name="160196896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196896">(Mar 07 2019 at 13:33)</a>:</h4>
<p>:-) </p>
<p>That's for debugger as in lldb. If you don't need that, <code>F5</code> (Launch the Debug Extension, this will build the extension and the lsp server.) should "Just Work".</p>



<a name="160196905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196905">(Mar 07 2019 at 13:34)</a>:</h4>
<p>okay I'll try <code>F5</code></p>



<a name="160196953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160196953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160196953">(Mar 07 2019 at 13:34)</a>:</h4>
<p>That said, I have "overhaul developer docs" on my todo list: we have contributing.md, architecture.md, guide.md, debugging.md, and this is just not great :(</p>



<a name="160198712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160198712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160198712">(Mar 07 2019 at 13:59)</a>:</h4>
<p>hmm. Now I'm not even sure if I was running the <code>ra_lsp_server</code> that I thought I was; I hasn't overrode that setting in my settings.json for VS Code</p>



<a name="160198751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160198751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160198751">(Mar 07 2019 at 13:59)</a>:</h4>
<p>is there a way to tell the ra_lsp to quit and restart itself from VS Code? Or do I need to quit VS Code and restart it (or disable the extension and reenable it?)</p>



<a name="160198846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160198846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160198846">(Mar 07 2019 at 14:00)</a>:</h4>
<p>/me is a VS Code newbie</p>



<a name="160198847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160198847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160198847">(Mar 07 2019 at 14:00)</a>:</h4>
<p>I think you need to restart VS Code</p>



<a name="160198872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160198872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160198872">(Mar 07 2019 at 14:00)</a>:</h4>
<p>/me was VS Code newbie in september</p>



<a name="160199520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199520">(Mar 07 2019 at 14:07)</a>:</h4>
<p>So, coming back to the original issue of "unknown file". My first hypothesis would be that this file just don't reside under any root, known to rust-analyzer, so I would try to add a <code>println</code> to the place where we initialize workspace.</p>



<a name="160199566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vipentti <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199566">(Mar 07 2019 at 14:08)</a>:</h4>
<p>I think you can also run "Reload Window" in vscode to get it to restart lsp</p>



<a name="160199610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199610">(Mar 07 2019 at 14:08)</a>:</h4>
<p>If we don't have the root of the workspace as root that meanas that VS Code/rust-analyzer integration layer contains a bug</p>



<a name="160199681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199681">(Mar 07 2019 at 14:09)</a>:</h4>
<p>how/where does rust-analyzer decide what/where is the sysroot? When I run it from the command line, I'm getting messages about rust-src missing and asking me to install that via rustup, but I've already done that.</p>



<a name="160199693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199693">(Mar 07 2019 at 14:09)</a>:</h4>
<p>If we do have the root, but don't see the file, that either means a bug in VFS, or some timing issues/misconceptions (i.e, VS Code asks as about file before we've scanned it, and without sending didOpenDOcument event)</p>



<a name="160199737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199737">(Mar 07 2019 at 14:09)</a>:</h4>
<p>it runts <code>rustc --print sysroot</code> and looks for src dir there</p>



<a name="160199750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199750">(Mar 07 2019 at 14:09)</a>:</h4>
<p>ah!</p>



<a name="160199755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199755">(Mar 07 2019 at 14:09)</a>:</h4>
<p>perhaps ra uses different toolchain than the one you've added roots to?</p>



<a name="160199817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199817">(Mar 07 2019 at 14:10)</a>:</h4>
<p>yeah, I have some wonkiness in my setup that can cause all kinds of problems there I bet</p>



<a name="160199821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vipentti <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199821">(Mar 07 2019 at 14:10)</a>:</h4>
<p>Hmm, do you need RUST_SRC_PATH set?</p>



<a name="160199875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vipentti <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199875">(Mar 07 2019 at 14:10)</a>:</h4>
<p>Or do we figure out the rust-src automatically?</p>



<a name="160199884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199884">(Mar 07 2019 at 14:10)</a>:</h4>
<p>franktly, I don't know <em>which</em> toolchain is used by rust-analyzer exactly :) I guess, the one in the <code>PATH</code> that Vscode sees?</p>



<a name="160199894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199894">(Mar 07 2019 at 14:10)</a>:</h4>
<p>(e.g. I have things set up to use homebrew by default, which <em>does</em> have rust installed, but I never use that; I manually source <code>~/.cargo/env</code> when I want to actually hack)</p>



<a name="160199943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160199943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160199943">(Mar 07 2019 at 14:11)</a>:</h4>
<p>code wide, the entry point to project discovery is here: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/5232099977d07492c1b6d5e6163c70d4f6eb07df/crates/ra_project_model/src/lib.rs#L44-L48" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/5232099977d07492c1b6d5e6163c70d4f6eb07df/crates/ra_project_model/src/lib.rs#L44-L48">https://github.com/rust-analyzer/rust-analyzer/blob/5232099977d07492c1b6d5e6163c70d4f6eb07df/crates/ra_project_model/src/lib.rs#L44-L48</a></p>



<a name="160200062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200062">(Mar 07 2019 at 14:12)</a>:</h4>
<p>okay, now that I (remembered to) run <code>source ~/.cargo/env</code> in my terminal before running <code>code</code> from that terminal, <code>rust-analyzer</code> seems to work. Next step: figure out whether the same root problem is what is plaguing Visual Studio Code when I <em>don't</em> run it from the terminal.</p>



<a name="160200103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vipentti <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200103">(Mar 07 2019 at 14:13)</a>:</h4>
<p>Do you have rustc in your path?</p>



<a name="160200115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200115">(Mar 07 2019 at 14:13)</a>:</h4>
<p>I did and do</p>



<a name="160200146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200146">(Mar 07 2019 at 14:13)</a>:</h4>
<p>but the default, from homebrew, was not the one I normally use</p>



<a name="160200161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200161">(Mar 07 2019 at 14:13)</a>:</h4>
<p>its like 1.30 and doesn't have the src installed, etc</p>



<a name="160200173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200173">(Mar 07 2019 at 14:14)</a>:</h4>
<p>I should just de-install it</p>



<a name="160200240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200240">(Mar 07 2019 at 14:14)</a>:</h4>
<p>because i think when it gets used it just ends up causing problems/confusion for me</p>



<a name="160200297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200297">(Mar 07 2019 at 14:15)</a>:</h4>
<p>(and likewise I think I was also using an out-of-date versus of rust-analyzer, because I hadn't previously told the settings.json to point at the one I had locally built.)</p>



<a name="160200712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200712">(Mar 07 2019 at 14:19)</a>:</h4>
<p>Filed <a href="https://github.com/rust-analyzer/rust-analyzer/issues/945" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/945">https://github.com/rust-analyzer/rust-analyzer/issues/945</a> to help with "unexpected version of rustc is picked up".</p>



<a name="160200763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200763">(Mar 07 2019 at 14:19)</a>:</h4>
<p>ah that is an excellent point</p>



<a name="160200782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200782">(Mar 07 2019 at 14:19)</a>:</h4>
<p>though... if there are multiple workspaces, can't they have distinct overrides?</p>



<a name="160200874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200874">(Mar 07 2019 at 14:20)</a>:</h4>
<p>I may not be using the word "workspace" correctly there</p>



<a name="160200912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200912">(Mar 07 2019 at 14:20)</a>:</h4>
<p>VS Code has a single workspace. But you can add multiple directories to it, and they can each represent distinct crates with distinct overrides</p>



<a name="160200921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200921">(Mar 07 2019 at 14:21)</a>:</h4>
<p>that is what I am musing about</p>



<a name="160200955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160200955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160200955">(Mar 07 2019 at 14:21)</a>:</h4>
<p>(maybe I should be posting these thoughts elsewhere, or hold back on them until I inspect more carefully.)</p>



<a name="160201107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201107">(Mar 07 2019 at 14:22)</a>:</h4>
<p>well, yes, I think "if you work on a set of projects, they must use the same rustc version for rust-analyzer"  is just the constraint we have to leave with.</p>



<a name="160201167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201167">(Mar 07 2019 at 14:23)</a>:</h4>
<p>seems reasonable. Probably should detect when they differ and issue a warning</p>



<a name="160201177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201177">(Mar 07 2019 at 14:23)</a>:</h4>
<p>I'll make a note on the ticket</p>



<a name="160201193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201193">(Mar 07 2019 at 14:23)</a>:</h4>
<p>Though, ideally, we should be able to state "language level" so that, for example, you can use <code>rustc 1.92.0</code> for code analysis, but have a setting to check that the code is in fact compatible with <code>rustc 1.62.0</code></p>



<a name="160201575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201575">(Mar 07 2019 at 14:27)</a>:</h4>
<p>In general, this "misconfiguraton" problems are a bane for IDE developers: they crop up fairly regularly, because folks use all kinds of weird set ups and you can't debug them, because everything works on your machine. </p>
<p>It pays off to build-in "smartness" into workspace discovery, so that users don't have to configure stuff themselves (that's why "using rustc from project dir" is better than an explicit setting for rustc). It's also helpful to issue "positive" notifications when stuff does work. In the recent versions of rust-analyzer, you get "workspace loaded" notification</p>



<a name="160201684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201684">(Mar 07 2019 at 14:28)</a>:</h4>
<p>right, I have been seeing that</p>



<a name="160201708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201708">(Mar 07 2019 at 14:28)</a>:</h4>
<p>but it was a little confusing, because it was coming up after the notficatin about the failure to find the rust src at the sysroot</p>



<a name="160201751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201751">(Mar 07 2019 at 14:29)</a>:</h4>
<p>and so I was trying to understand whether the second notification represented some sort of recovery after the first failure</p>



<a name="160201762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201762">(Mar 07 2019 at 14:29)</a>:</h4>
<p>or if they were unrelated</p>



<a name="160201835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160201835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160201835">(Mar 07 2019 at 14:29)</a>:</h4>
<p>(by the way, now that I've pointed my settings.json at my local build of <code>ra_lsp_server</code>, everything actually seems to be going very smoothly.)</p>



<a name="160202002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160202002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160202002">(Mar 07 2019 at 14:31)</a>:</h4>
<blockquote>
<p>(that's why "using rustc from project dir" is better than an explicit setting for rustc)</p>
</blockquote>
<p>i definitely agree inferring from project dir is the better initial <em>default</em>.</p>



<a name="160202532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160202532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160202532">(Mar 07 2019 at 14:37)</a>:</h4>
<blockquote>
<p>but it was a little confusing</p>
</blockquote>
<p>yeah... We do try to fail gracefully if Cargo or rustc is misconfigured. Ideally, if you don't have rust installed <em>at all</em>, you still should have completions for local variables and such. </p>
<p>I am fixing the "workspace loaded" notification to say "loaded $n packages", whihc should make it clearer if stuf works or fails</p>



<a name="160202693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160202693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160202693">(Mar 07 2019 at 14:38)</a>:</h4>
<p>BTW, the "unknown file" is a sort-of intentional dirty hack to surface misoconfiguration problems. </p>
<p>I think that to be 100% correct we should just go and read the unknown files from disk. Nothing in the LSP speck prevents that.</p>
<p>However, I've decided to treat that condition as a lound error for the time being, because it shows cleary if things are misconfigured. Looks like this hack worked as intended in this particular case .</p>



<a name="160293083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160293083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160293083">(Mar 08 2019 at 14:22)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> curious, which editor do you usually use? If that's Emacs, we do have a config for it in rust-analyer's repo</p>



<a name="160293150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160293150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160293150">(Mar 08 2019 at 14:22)</a>:</h4>
<p>yes I usually use Emacs and plan to try to investigate the .el code I saw in rust-analyzer</p>



<a name="160293177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160293177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160293177">(Mar 08 2019 at 14:23)</a>:</h4>
<p>but I figured I would be better off using VS Code at the outset</p>



<a name="160293203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/how%20to%20debug%20rust-analyzer%27s%20interaction%20with%20VS%20Code/near/160293203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/how.20to.20debug.20rust-analyzer&#x27;s.20interaction.20with.20VS.20Code.html#160293203">(Mar 08 2019 at 14:23)</a>:</h4>
<p>since I figured that had a larger audience and thus would provide a better initial out-of-the-box experience.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>